{% extends "base.html" %}

{% block title %} 积累 {% endblock %}
{% block body %}

    <div class="blog">
        <div class="container">
            <div class="row">
                <div class="col-xs-12 col-sm-6 col-md-8">
                    <div class="page-header">
                        {% for blog in blogs %}
                            <h3>{{ blog.caption }}</h3>
                            <h5><i class="fa fa-user"></i>{{ blog.author }} <i
                                    class="fa fa-calendar"></i>{{ blog.publish_time }} <i
                                    class="fa fa-tags"></i>{% for tg in blog.tags.all %}{{ tg.tag_name }},{% endfor %}
                            </h5>
                            <img src="../static/img/slider/{{ blog.title_photo }}" class="img-responsive" alt=""/>
                            {% load md2 %}
                            <p>{{ blog.content|truncatewords_html:50|safe|markdown }} </p>
                            <div class="ficon">
                                <a href="{% url 'detailblog' blog.id %}">Read more</a>
                            </div>

                        {% endfor %}

                        <div class="pagination">
    <span class="step-links">
        {% if blogs.has_previous %}
            <a href="?page={{ blogs.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ blogs.number }} of {{ blogs.paginator.num_pages }}.
        </span>

        {% if blogs.has_next %}
            <a href="?page={{ blogs.next_page_number }}">next</a>
        {% endif %}
    </span>
                        </div>

                    </div>


                    <nav>
                        <ul class="pager">
                            {% if blogs.has_previous %}
                                <li class="previous"><a href="?page={{ blogs.previous_page_number }}">上一页<span
                                        aria-hidden="true">←</span></a></li>

                            {% endif %}



                            {% for page in blogs.paginator.page_range %}
                                <li class="active"><a href="?page={{ page }}">{{ page }} <span
                                        class="sr-only">(current)</span></a></li>
                            {% endfor %}


                            <!--下一页-->
                            {% if blogs.has_next %}
                                <li class="next"><a href="?page={{ blogs.next_page_number }}">下一页<span
                                        aria-hidden="true">→</span></a></li>
                            {% endif %}
                        </ul>
                    </nav>

                </div>

                <div class="recents">
                    <div class="col-xs-6 col-md-4">
                        <h5>Search for.</h5>
                        <form class="form-search">
                            <input class="form-control" type="text" placeholder="Search..">
                        </form>
                        {% comment %}<div class="page-header">
							<h4>Recent Post</h4>
						</div>
						<div class="recent-post">
							<ul class="recent">
								<li><a href="#">Excellent Support</a></li>
								<li><a href="#">Business Theme</a></li>
								<li><a href="#">Technology</a></li>
								<li><a href="#">Internet</a></li>
								<li><a href="#">Tutorial</a></li>
								<li><a href="#">Development</a></li>
							</ul>
						</div>{% endcomment %}
                        <ul class="list-group">
                            <div class="page-header">
                                <h4>分类</h4>
                            </div>

                            {% for tag in tags %}
                                <li class="list-group-item">
                                    <span class="badge">{{ tag.count }}</span>
                                    <a href="{% url 'list_tag' tag.tag_name %}" alt="">{{ tag.tag_name }}</a>
                                </li>
                            {% endfor %}

                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>



{% endblock %}
